﻿<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="clk_guanli.aspx.cs" Inherits="zhzx_bianji" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑材料基础库</title>
    <style type="text/css">


        .style7
        {
            font-size: small;
            text-align: left;
        }
        .style8
        {
            text-align: center;
        }
        .style9
        {
            font-size: small;
        }
        .left
        {
            width: 48%;
            float: left;
        }
        .right
        {
            width: 48%;
            float: right;
        }
        .style10
        {
            font-size: small;
            color: #FF6600;
        }
        .style11
        {
            color: #FF0000;
        }
        .style12
        {
            color: #0000FF;
        }
        .auto-style1 {
            height: 29.25pt;
            width: 24pt;
            color: windowtext;
            font-weight: 400;
            font-style: normal;
            text-decoration: none;
            font-family: 宋体;
            text-align: center;
            vertical-align: middle;
            white-space: nowrap;
            border: .5pt solid windowtext;
            padding-left: 1px;
            padding-right: 1px;
            padding-top: 1px;
        }
        .auto-style2 {
            width: 108pt;
            color: windowtext;
            font-weight: 400;
            font-style: normal;
            text-decoration: none;
            font-family: 宋体;
            text-align: center;
            vertical-align: middle;
            white-space: nowrap;
            border: .5pt solid windowtext;
            padding-left: 1px;
            padding-right: 1px;
            padding-top: 1px;
        }
        .auto-style6 {
            height: 14.25pt;
            color: windowtext;
            font-weight: 400;
            font-style: normal;
            text-decoration: none;
            font-family: 宋体;
            text-align: center;
            vertical-align: middle;
            white-space: nowrap;
            border: .5pt solid windowtext;
            padding-left: 1px;
            padding-right: 1px;
            padding-top: 1px;
        }
        .auto-style7 {
            color: windowtext;
            font-weight: 400;
            font-style: normal;
            text-decoration: none;
            font-family: 宋体;
            text-align: general;
            vertical-align: middle;
            white-space: nowrap;
            border: .5pt solid windowtext;
            padding-left: 1px;
            padding-right: 1px;
            padding-top: 1px;
        }
        </style>
</head>
<body background="images/login-bg.jpg">
    <form id="form1" runat="server">
    
    <div class="style7">
    
        <span class="style7">当前位置：</span><asp:HyperLink ID="HyperLink1" runat="server" 
            CssClass="style7" NavigateUrl="~/index.aspx" style="color: #000000" 
            ToolTip="点击返回主页面">主页面</asp:HyperLink>
        <span class="style7">→ 编辑材料基础库</span><br class="style7" />
        </div>
    <div class="style8" style="margin-top: 0px">
        <b style="text-align: center">
        <br />
        编辑材料基础库<br />
        <br />
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <span class="style9">类别</span><b style="text-align: center"><b><asp:DropDownList 
                    ID="DropDownList_leibie1" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDataSource_leibie1" DataTextField="leibie1" 
                    DataValueField="leibie1" CssClass="style9">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource_leibie1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>" 
                    SelectCommand="SELECT * FROM [cailiaoleibie1] ORDER BY [px]">
                </asp:SqlDataSource>
                <br />
                </b>
                <br />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="j_id" DataSourceID="SqlDataSource1" 
                    EnableModelValidation="True" CellPadding="4" EmptyDataText="没有符合条件的数据" 
                    ForeColor="#333333" GridLines="None" style="font-size: small" 
                    AllowPaging="True" onrowdatabound="GridView1_RowDataBound" PageSize="30" Font-Bold="False" AllowSorting="True">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" HeaderText="删除" />
                        <asp:BoundField DataField="j_id" HeaderText="序" InsertVisible="False" 
                            ReadOnly="True" SortExpression="j_id" />
                        <asp:BoundField DataField="xuhao" HeaderText="排序号" SortExpression="xuhao" />
                        <asp:BoundField DataField="leibie1" HeaderText="类别" 
                            SortExpression="leibie1" >
                        <ControlStyle Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="leibie2" HeaderText="子类别" 
                            SortExpression="leibie2" Visible="False" />
                        <asp:BoundField DataField="bianhao" HeaderText="物资编码" 
                            SortExpression="bianhao" >
                        <ControlStyle Width="95px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="mingcheng" HeaderText="物资名称" 
                            SortExpression="mingcheng" >
                        <ControlStyle Width="200px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="guige" HeaderText="规格型号" SortExpression="guige" >
                        <ControlStyle Width="200px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="tuhao" HeaderText="图号" SortExpression="tuhao" Visible="False" />
                        <asp:BoundField DataField="danwei" HeaderText="单位" 
                            SortExpression="danwei" >
                        <ControlStyle Width="20px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="danjia" HeaderText="目录价" 
                            SortExpression="danjia" >
                        <ControlStyle Width="40px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="beizhu" HeaderText="备注" 
                            SortExpression="beizhu" >
                        <ControlStyle Width="30px" />
                        </asp:BoundField>
                        <asp:CommandField ShowEditButton="True" HeaderText="编辑" />
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>" 
                    DeleteCommand="DELETE FROM [cailiaojichuku] WHERE [j_id] = @j_id" 
                    InsertCommand="INSERT INTO [cailiaojichuku] ([xuhao], [leibie1], [leibie2], [bianhao], [mingcheng], [guige], [tuhao], [danwei], [danjia], [beizhu]) VALUES (@xuhao, @leibie1, @leibie2, @bianhao, @mingcheng, @guige, @tuhao, @danwei, @danjia, @beizhu)" 
                    SelectCommand="SELECT * FROM [cailiaojichuku] WHERE ([leibie1] = @leibie1) ORDER BY [xuhao]" 
                    UpdateCommand="UPDATE [cailiaojichuku] SET [xuhao] = @xuhao, [leibie1] = @leibie1, [leibie2] = @leibie2, [bianhao] = @bianhao, [mingcheng] = @mingcheng, [guige] = @guige, [tuhao] = @tuhao, [danwei] = @danwei, [danjia] = @danjia, [beizhu] = @beizhu WHERE [j_id] = @j_id">
                    <DeleteParameters>
                        <asp:Parameter Name="j_id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="xuhao" Type="Int32" />
                        <asp:Parameter Name="leibie1" Type="String" />
                        <asp:Parameter Name="leibie2" Type="String" />
                        <asp:Parameter Name="bianhao" Type="String" />
                        <asp:Parameter Name="mingcheng" Type="String" />
                        <asp:Parameter Name="guige" Type="String" />
                        <asp:Parameter Name="tuhao" Type="String" />
                        <asp:Parameter Name="danwei" Type="String" />
                        <asp:Parameter Name="danjia" Type="Double" />
                        <asp:Parameter Name="beizhu" Type="String" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList_leibie1" Name="leibie1" 
                            PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="xuhao" Type="Int32" />
                        <asp:Parameter Name="leibie1" Type="String" />
                        <asp:Parameter Name="leibie2" Type="String" />
                        <asp:Parameter Name="bianhao" Type="String" />
                        <asp:Parameter Name="mingcheng" Type="String" />
                        <asp:Parameter Name="guige" Type="String" />
                        <asp:Parameter Name="tuhao" Type="String" />
                        <asp:Parameter Name="danwei" Type="String" />
                        <asp:Parameter Name="danjia" Type="Double" />
                        <asp:Parameter Name="beizhu" Type="String" />
                        <asp:Parameter Name="j_id" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <br />
                <br />
                材料基础库添加<span class="style10"><br />
                <br />
                （特别注意：类别一定要与右表相同，否则将无法正确显示，<br /> 如需更改，请点击页面上方类别下拉菜单）      </span><br /> 
                <br />
                <div class="left">
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                        DataKeyNames="j_id" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
                        EnableModelValidation="True" Height="50px" 
                        onprerender="DetailsView1_PreRender" style="font-size: small" Width="325px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Font-Bold="False">
                        <Fields>
                            <asp:BoundField DataField="j_id" HeaderText="j_id" InsertVisible="False" 
                                ReadOnly="True" SortExpression="j_id" />
                            <asp:BoundField DataField="xuhao" HeaderText="排序号" SortExpression="xuhao" />
                            <asp:TemplateField HeaderText="类别" SortExpression="leibie1">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("leibie1") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("leibie1") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("leibie1") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="子类别" SortExpression="leibie2" Visible="False">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("leibie2") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("leibie2") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("leibie2") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="bianhao" HeaderText="物资编码" 
                                SortExpression="bianhao" />
                            <asp:BoundField DataField="mingcheng" HeaderText="物资名称" 
                                SortExpression="mingcheng" />
                            <asp:TemplateField HeaderText="规格型号" SortExpression="guige">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("guige") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("guige") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox3" Display="Dynamic" ErrorMessage="请输入规格，如无规格，请输入&quot;/&quot;" ValidationGroup="1"></asp:RequiredFieldValidator>
                                    <br />
                                    </b></b><span style="text-align: center"><span class="style11" 
                                        style="text-align: center">
                                    <br />
                                    输入时请注意</span><span class="style12" 
                                        style="text-align: center"><br /></span><span class="style11" 
                                        style="text-align: center">用</span><span class="style12" 
                                        style="text-align: center">寸</span><span class="style11" 
                                        style="text-align: center">代替</span><span class="style12" 
                                        style="text-align: center">&quot;</span><span class="style11" 
                                        style="text-align: center">或</span><span class="style12" 
                                        style="text-align: center">&#39;</span><span class="style11" 
                                        style="text-align: center"><br /></span><span class="style12" 
                                        style="text-align: center"><span class="style11" style="text-align: center">用</span>x</span><span class="style11" style="text-align: center">或</span><span 
                                        class="style12" style="text-align: center">*</span><span class="style11" 
                                        style="text-align: center">代替</span><span class="style12" 
                                        style="text-align: center">×<span class="style11" 
                                        style="text-align: center"><b style="text-align: center"><br /></b>用</span>度<span 
                                        class="style11" style="text-align: center">代替</span></span></span></b></b></b><span 
                                        style="text-align: center"></b></span><b style="text-align: center"><span 
                                        class="style12">°</span> </b>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("guige") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="tuhao" HeaderText="图号" SortExpression="tuhao" Visible="False" />
                            <asp:BoundField DataField="danwei" HeaderText="单位" SortExpression="danwei" />
                            <asp:BoundField DataField="danjia" HeaderText="目录价" SortExpression="danjia" />
                            <asp:BoundField DataField="beizhu" HeaderText="备注" SortExpression="beizhu" />
                            <asp:CommandField ShowInsertButton="True" ValidationGroup="1" />
                        </Fields>
                    </asp:DetailsView>
                </div>
                <b style="text-align: center"></b><b style="text-align: center">
                <div class="right">
                    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 114pt; font-size: small;" width="186" x:str="">
                        <tr height="39">
                            <td class="auto-style1" height="39" width="32">序</td>
                            <td class="auto-style2" width="144">类别</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">1</td>
                            <td class="auto-style7">接触网配件</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">2</td>
                            <td class="auto-style7">供电电力金具</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">3</td>
                            <td class="auto-style7">机电电工产品</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">4</td>
                            <td class="auto-style7">电气产品及绝缘子</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">5</td>
                            <td class="auto-style7">线缆及附件</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">6</td>
                            <td class="auto-style7">标志标牌</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">7</td>
                            <td class="auto-style7">化工油脂</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">8</td>
                            <td class="auto-style7">标准紧固件</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">9</td>
                            <td class="auto-style7">钢材</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">10</td>
                            <td class="auto-style7">水暖五金器材</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">11</td>
                            <td class="auto-style7">杂备品</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">12</td>
                            <td class="auto-style7">工具</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">13</td>
                            <td class="auto-style7">工具配件</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">14</td>
                            <td class="auto-style7">劳保用品</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">15</td>
                            <td class="auto-style7">汽轨配件</td>
                        </tr>
                        <tr height="19">
                            <td class="auto-style6" height="19" x:num="">16</td>
                            <td class="auto-style7">其它</td>
                        </tr>
                    </table>
                </div>
                <br />
                </b><b style="text-align: center"></b>
                </b>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
